var http = require('http')
var one = require('./one')
var fs = require('fs')
// one.pp('kskdfkdsfjklJKjk好机会')
var server = http.createServer()
server.on('request',(req,res)=>{
  var url = req.url;
  
  if(url=='/a'){
    fs.readFile('./web/flex.html',(err,data)=>{
      console.log(data)
      if(err){
        res.setHeader('Content-Type','text/plain;charset=utf-8')
        res.write(err)
      }else{
        // res.setHeader('Content-Type','text/html;charset=utf-8')
        res.write(data)
      }
      res.end()
    })

  }else{
    res.write('404')
    res.end()
  }

  var obj = {
    a:'<h3>上升空间方式的回复</h3>'
  }
  
  
})
server.listen(999,()=>{
  console.log('启动');
  
})